package com.ccys.doctor.service.impl;

import com.ccys.common.vo.ResponseResultApp;
import com.ccys.db.cache.UserUtil;
import com.ccys.db.entity.TblDoctor;
import com.ccys.db.mapper.TblClinicMapper;
import com.ccys.db.vo.doctor.clinic.GetAllClinicVo;
import com.ccys.doctor.service.ClinicService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @program: WhiteCoat
 * @description: 诊所
 * @author: ZhangJingCan
 * @create: 2024-02-08 16:25
 **/

@Service
public class ClinicServiceImpl implements ClinicService {

    @Resource
    private TblClinicMapper tblClinicMapper;

    @Override
    public ResponseResultApp<List<GetAllClinicVo>> getAllClinic() {
        TblDoctor doctor = UserUtil.getCurLoginDoctor();
        List<GetAllClinicVo> list = tblClinicMapper.getAllClinicByDoctorIdAndByCompany(doctor.getId());
        return ResponseResultApp.success(list);
    }
}
